package com.jhclothing.common.enums;

import com.jhclothing.common.utils.StringUtils;

/**
 * 服饰类别
 */
public enum ClothingSex {

    MAN("0", "男款"),
    WOMAN("1", "女款"),
    UNKNOWN("2", "未知");

    private String code;
    private String name;

    ClothingSex(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getClothingSexNameByCode(String code) {
        if (StringUtils.isEmpty(code)) {
            return "";
        }
        for (ClothingSex clothingSex : ClothingSex.values()) {
            if (clothingSex.code.equals(code)) {
                return clothingSex.name;
            }
        }
        return "";
    }
}
